/**
 * 
 */
package com.thor.palmmall.rest.tenant.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.tenant.AContactInfos;
import com.thor.palmmall.spi.tenant.SContactInfos;

/**
 * @author NuoSa
 *
 * @since 1.0
 */
public class AContactInfosConverter implements Converter<SContactInfos, AContactInfos> {

  public static AContactInfosConverter getInstance() {
    if (instance == null)
      instance = new AContactInfosConverter();
    return instance;
  }

  private static AContactInfosConverter instance;

  private AContactInfosConverter() {
  }

  @Override
  public AContactInfos convert(SContactInfos source) {
    if (source == null) {
      return null;
    }
    AContactInfos target = new AContactInfos();
    target.setAddress(source.getAddress());
    target.setContactor(source.getContactor());
    target.setEmail(source.getEmail());
    target.setFax(source.getFax());
    target.setMobile(source.getMobile());
    target.setPhone(source.getPhone());
    target.setPost(source.getPost());
    target.setUuid(source.getUuid());
    target.setPermGroupId(source.getPermGroupId());
    target.setPermGroupTitle(source.getPermGroupTitle());
    return target;
  }

}
